package im.frape;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;

public class Settings extends PreferenceActivity {

	private boolean hideOfflineContacts;
	private String notificationRingtone;

	/** Called when the activity is first created. */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.settings);
	}

	@Override
	protected void onStart() {
		super.onStart();
		loadPrefs();
	}

	private void loadPrefs() {
		// Get the xml/settings.xml preferences
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
		hideOfflineContacts = prefs.getBoolean("hideOfflineContacts", true);
		notificationRingtone = prefs.getString("notificationRingtone", "DEFAULT_RINGTONE_URI");
	}

	public boolean isHideOfflineContacts() {
		return hideOfflineContacts;
	}

	public void setHideOfflineContacts(boolean hideOfflineContacts) {
		this.hideOfflineContacts = hideOfflineContacts;
	}

	public String getNotificationRingtone() {
		return notificationRingtone;
	}

	public void setNotificationRingtone(String notificationRingtone) {
		this.notificationRingtone = notificationRingtone;
	}

}
